<?php
	$name = $_POST['name'];
    //$ip_add = $_POST['ip_add'];
	//$company = $_POST['orgainisation'];
	$email = $_POST['email'];
	$mobile = $_POST['phone'];
	$message = $_POST['message'];
//mail to send to user starts here
{
	$email_msg = 'A visitor wants to contact:
	Name:'.$name.'
	Email:'.$email.'
	Phone:'.$mobile.'
	Message:'.$message.'';
	$email_msg .='';
	
	$headers  = 'MIME-Version: 1.0' . "\r\n";
	$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
	$headers .= 'From: '.$name.' <'.$email.'>' . "\r\n";		   
	$headers = 'From: Reyansh Software Technologies Website User';

	if($email !=null && $name !=null && $mobile !=null){
		mail('contact@rsofttech.com','Contact form has been filled',$email_msg,'rsofttech.com');
			
		echo '<div style="width:400px;height:200px;-webkit-border-radius: 20px;-moz-border-radius: 20px;border-radius: 20px;background-color:#FFFFFF; font-family:Helvetica;"><center>Thanks for contacting us.</br>
		We will get in touch with you soon.</center>
		</div>';	
}
else{
	echo'<div style="width:400px;height:200px;-webkit-border-radius: 20px;-moz-border-radius: 20px;border-radius: color:#FF0000; 20px;background-color:#FFFFFF; font-family:Helvetica;"><center>Please fill up all the mendatory fields.<br/> <a href="contactForm.html">Back to contact form</a></center>
		</div> ';
	
}}	
//mail to send to user ends here
?> 